<template>
  <div>
    <div>{{ num }}</div>
    <button @click="increment">+</button>
  </div>
</template>

<script lang='ts' setup>
import {ref,watch} from 'vue'
let num=ref<number>(0)

const increment=()=>{
  num.value++
  num.value++
  num.value++
}

watch(num,()=>{
    console.log('*******************');
},{
  immediate:false,
  flush:'sync'
})
</script>

<style lang='scss' scoped>
</style>